<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <link rel="stylesheet" media="screen" type="text/css" href="./style.css" />
  <link rel="stylesheet" media="screen" type="text/css" href="./design.css" />
  <link rel="stylesheet" media="print" type="text/css" href="./print.css" />

  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="dokuwiki export">

<p>
<em>Translations of this page are also available in the following languages:</em> <a href="geda-format_translation.ru.html" class="wikilink1" title="geda-format_translation.ru.html">Русский</a>.
</p>

<h1 class="sectionedit1"><a name="file_format_translation" id="file_format_translation">File format translation</a></h1>
<div class="level1">

<p>
We need a universal translator system that can translate in all directions between gEDA tools, possible future gEDA tools, and outside tools that are likely to be used with gEDA tools.
</p>

</div>
<!-- EDIT1 SECTION "File format translation" [121-345] -->
<h2 class="sectionedit2"><a name="scope" id="scope">Scope</a></h2>
<div class="level2">

<p>
Of course, everything to everything is not reasonable.  So, set a limit of gEDA tools, possible future gEDA tools, and outside tools that are likely to be used with gEDA tools.  Of course, tool formats where translation doesn&#039;t make sense don&#039;t need to be supported.
</p>

<p>
The idea is to have an intermediate format.  First translate to the intermediate format, then translate out.  The intermediate format should be sufficiently expressive that there can be a lossless round trip from any gEDA tool format to the intermediate format and back.
</p>

<p>
Lossless means that the resultant file is equivalent in how it works.  It is not necessary to preserve formatting and other things that don&#039;t matter.
</p>

<p>
All of the formats needing translation presently consist of lists of objects, with some kind of encapsulation.  Each object has connections and attributes.
</p>

<p>
This suggests the possible of a standard netlist format as the intermediate format.
</p>

<p>
Further discussion related only to formats that fit this model.
</p>

<p>
If possible, the format chosen should have a history of use for at least part of this, and have a published specification that is externally controlled and freely available.
</p>

<p>
There needs to be a way to merge changes from any target/source without messing up other parts.
</p>

</div>
<!-- EDIT2 SECTION "Scope" [346-1634] -->
<h3 class="sectionedit3"><a name="tool_types_needing_support" id="tool_types_needing_support">Tool types needing support</a></h3>
<div class="level3">
<ul>
<li class="level1"><div class="li"> schematic</div>
</li>
<li class="level1"><div class="li"> layout</div>
</li>
<li class="level1"><div class="li"> simulation</div>
</li>
</ul>

</div>
<!-- EDIT3 SECTION "Tool types needing support" [1635-1712] -->
<h3 class="sectionedit4"><a name="geda_tools" id="geda_tools">gEDA tools</a></h3>
<div class="level3">

<p>
Lossless round trip is required, so archival storage can use the intermediate format.
</p>
<ul>
<li class="level1"><div class="li"> gschem</div>
</li>
<li class="level1"><div class="li"> pcb</div>
</li>
<li class="level1"><div class="li"> gnucap</div>
</li>
<li class="level1"><div class="li"> Icarus Verilog</div>
</li>
</ul>

</div>
<!-- EDIT4 SECTION "gEDA tools" [1713-1869] -->
<h3 class="sectionedit5"><a name="other_free_tools_that_should_be_well_supported" id="other_free_tools_that_should_be_well_supported">Other free tools that should be well supported</a></h3>
<div class="level3">

<p>
These tools are free, too.  The standard needs to support them on an equal basis with gEDA.
</p>
<ul>
<li class="level1"><div class="li"> NGspice</div>
</li>
<li class="level1"><div class="li"> Qucs</div>
</li>
<li class="level1"><div class="li"> Kicad</div>
</li>
<li class="level1"><div class="li"> Magic</div>
</li>
<li class="level1"><div class="li"> Electric</div>
</li>
<li class="level1"><div class="li"> Xcircuit</div>
</li>
<li class="level1"><div class="li"> Fritzing</div>
</li>
</ul>

</div>
<!-- EDIT5 SECTION "Other free tools that should be well supported" [1870-2100] -->
<h3 class="sectionedit6"><a name="non-free_import_and_export" id="non-free_import_and_export">Non-free import and export</a></h3>
<div class="level3">

<p>
Support for these will allow gEDA tools to play nice with the commercial world.  Basic functionality is needed, but it doesn&#039;t need to be lossless.  Lossless should be possible, but it is not a high priority to actually implement it.
</p>
<ul>
<li class="level1"><div class="li"> Eagle</div>
</li>
<li class="level1"><div class="li"> Orcad</div>
</li>
<li class="level1"><div class="li"> LTspice</div>
</li>
<li class="level1"><div class="li"> Pads</div>
</li>
</ul>

</div>
<!-- EDIT6 SECTION "Non-free import and export" [2101-2413] -->
<h3 class="sectionedit7"><a name="geda_missing_functionality" id="geda_missing_functionality">gEDA missing functionality</a></h3>
<div class="level3">

<p>
Hopefully having a translator system will provide a seed so these can be done.
</p>
<ul>
<li class="level1"><div class="li"> Back annotation from layout or simulation to schematic</div>
</li>
<li class="level1"><div class="li"> Static timing analysis</div>
</li>
<li class="level1"><div class="li"> Post-layout signal integrity simulation.</div>
</li>
<li class="level1"><div class="li"> Layout - schematic comparison</div>
</li>
<li class="level1"><div class="li"> Use of the same schematic for the whole project.</div>
</li>
</ul>

</div>
<!-- EDIT7 SECTION "gEDA missing functionality" [2414-2748] -->
<h3 class="sectionedit8"><a name="explicitly_not_supported" id="explicitly_not_supported">Explicitly not supported</a></h3>
<div class="level3">
<ul>
<li class="level1"><div class="li"> Plotting</div>
</li>
<li class="level1"><div class="li"> Commands</div>
</li>
<li class="level1"><div class="li"> Behavioral modeling</div>
</li>
</ul>

</div>
<!-- EDIT8 SECTION "Explicitly not supported" [2749-2834] -->
<h2 class="sectionedit9"><a name="concepts" id="concepts">Concepts</a></h2>
<div class="level2">

<p>
All of these consist of lists of objects, with connections and attributes.
</p>

<p>
It is tradition that a netlist is used for interchange, but the traditional approach only goes one way, because information is lost in the translation.
</p>

<p>
The format must convey the meaning, not necessarily in the same way as the tool&#039;s native format or internal storage.
</p>

<p>
It is not necessary to translate parts that are usually in libraries, and are tool specific, such as models, symbols, or footprints.
</p>

<p>
All contenders for possible formats must support a loss round-trip to any other.
</p>

</div>
<!-- EDIT9 SECTION "Concepts" [2835-3419] -->
<h3 class="sectionedit10"><a name="some_possible_formats" id="some_possible_formats">Some possible formats</a></h3>
<div class="level3">

</div>

<h4><a name="spice" id="spice">Spice</a></h4>
<div class="level4">

<p>
A popular netlist format.  It has a history of use for interchange, but not yet for physical placement.  Problems: irregular syntax, not sufficiently expressive.  These problems have been a major hassle for years for developers.  It is well accepted, but not by people who know it well.
</p>

</div>

<h4><a name="verilog" id="verilog">Verilog</a></h4>
<div class="level4">

<p>
The structural subset is a good netlist format.  It is regular, sufficiently expressive, and has a published standard.  It has a history of use for interchange, but not yet for physical placement.
</p>

</div>

<h4><a name="vhdl" id="vhdl">VHDL</a></h4>
<div class="level4">

<p>
The structural subset is a good netlist format.  It is regular, sufficiently expressive, and has a published standard.  It has a history of use for interchange, but not yet for physical placement.
</p>

</div>

<h4><a name="spectre" id="spectre">Spectre</a></h4>
<div class="level4">

<p>
The structural subset is a good netlist format.  It is regular, sufficiently expressive, but belongs to one company (Cadence), so rule it out.  It has a history of use for simulation only.
</p>

</div>

<h4><a name="xml" id="xml">XML</a></h4>
<div class="level4">

<p>
<acronym title="Extensible Markup Language">XML</acronym> is not really a format but a syntax.  A good format can easily be made based on <acronym title="Extensible Markup Language">XML</acronym>, but has no history of use in a similar context.  The syntax is well documented but there is no outside documentation of application in any related use.
</p>

</div>
<!-- EDIT10 SECTION "Some possible formats" [3420-4644] -->
<h3 class="sectionedit11"><a name="representation_of_physical_placement" id="representation_of_physical_placement">Representation of physical placement</a></h3>
<div class="level3">

<p>
This part is the only part where there is not a strong history of use for VHDL and Verilog.
</p>

<p>
Ideas:
</p>
<ul>
<li class="level1"><div class="li"> Nets are also objects with connections and attributes.  Nets have meaning in all contexts.</div>
</li>
<li class="level1"><div class="li"> A place on a schematic can be considered to be an object, with connections and attributes.</div>
</li>
<li class="level1"><div class="li"> Pads, connectors, thermals, vias .. are also objects, with connections and attributes.</div>
</li>
<li class="level1"><div class="li"> Use `define (assuming Verilog format) to set aside sections that have meaning in one context but not another.</div>
</li>
<li class="level1"><div class="li"> This is a high level description.  Take a high level view across all.  It&#039;s not lines, boxes, and circles.</div>
</li>
<li class="level1"><div class="li"> If you must, lines, boxes, and circles can be objects too, but not translatable because they have no meaning in other contexts.</div>
</li>
<li class="level1"><div class="li"> Attributes that have no meaning are silently ignored.  Attributes that have meaning in one context but not in another context are ignored where they have no meaning.</div>
</li>
</ul>

</div>
<!-- EDIT11 SECTION "Representation of physical placement" [4645-5602] -->
<h2 class="sectionedit12"><a name="applications" id="applications">Applications</a></h2>
<div class="level2">

<p>
Choosing the Verilog format as one possibility.
</p>

<p>
The unit of encapsulation is the “module”:
</p>
<pre class="code">module my-module(connections);
// contents
endmodule</pre>

<p>
Each object in the list has a consistent syntax:
</p>
<pre class="code">type #(attributes) name (connections);</pre>

<p>
Example:
</p>
<pre class="code">resistor #(.r(1k)) r123 (a, b);
resistor #(.r(1k)) r234 (.p(b), .n(c));</pre>

<p>
“r” is the name of an attribute.  “1k” is the value (a string).
</p>

<p>
In the first example, connections are determined by order.  In the second, they are mapped by name.  Node “b” connects to pin “p” and node “c” connects to pin “n”.
</p>

<p>
A “net” is also an object.
</p>

<p>
In the above example, both connect to node b directly.  In a schematic representation the connection would not be direct, but through a “net”
</p>
<pre class="code">resistor #(.r(1k)) r123 (.p(a1), .n(b1));
resistor #(.r(1k)) r125 (.p(b2), .n(c2));
net b (.1(b1), .2(b2));</pre>

<p>
The name of the net is “b”.  It has no attributes.
</p>

<p>
For schematic, you can now place the nodes:
</p>
<pre class="code">place #(.x(1222), .y(3438)) place11333 (b1);
place #(.x(4334), .y(8433)) place34894 (b2);
place #(.x(9393), .y(4232)) place49334 (a1);
place #(.x(2932), .y(2384)) place34983 (c2);</pre>

<p>
Portions that apply in only certain contexts can be selectively included with &#039;ifdef:
</p>
<pre class="code">module my_circuit;
  `ifdef SCHEMATIC
    place ...
    place ...
  `endif
   res ...
   res ...
   net ...
endmodule</pre>

<p>
Complex nets can be encapsulated:
</p>
<pre class="code">module net23842 (1,2,3);
  net n23482 (1,2);
  net n84333 (2,3);
  `ifdef SCHEMATIC
    place ...
    place ...
    place ...
  `endif
endmodule</pre>
<pre class="code">module net9393 (1,2);
  net #(.color(blue), .thickness(thin)) n38423 (1,2);
endmodule</pre>

</div>
<!-- EDIT12 SECTION "Applications" [5603-] --></div>
</body>
</html>
